//
//  WMEAFNetworking.h
//  WMEMusic
//
//  Created by 恩叔 on 16/4/12.
//  Copyright © 2016年 enshu. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^BlockOfSuccess)(id result);
typedef NS_ENUM(NSInteger, WMEResponseStyle) {
    WMEJOSN,
    WMEXML,
    WMEDATA,
};

typedef NS_ENUM(NSInteger, WMEBodyRequestStyle) {
    WMERequestJSON,
    WMERequestString,
};

@interface WMEAFNetworking : NSObject


+(void)GETNetWithUrl:(NSString *)url body:(id)body headerFile:(NSDictionary *)header response:(WMEResponseStyle)responseStyle success:(BlockOfSuccess)success failure:(void (^)(NSError *error))failure;

+(void)POSTNetWithUrl:(NSString *)url body:(id)body bodyStyle:(WMEBodyRequestStyle)bodyRequestStyle headerFile:(NSDictionary *)header response:(WMEResponseStyle)responseStyle success:(BlockOfSuccess)success failure:(void (^)(NSError *error))failure;

// 根据网络请求的特点，不同的地方就是请求地址和分析数据的方式不同，就把这两部分分别作为方法参数
+ (void)getDataWithUrl:(NSString *)str completion:(void(^)(NSData *data))block;


@end
